package com.briup.mt.web.controller;
import com.briup.mt.bean.BaseRole;
import com.briup.mt.service.IBaseRoleService;
import com.briup.mt.utils.Message;
import com.briup.mt.utils.MessageUtil;
import io.swagger.annotations.ApiImplicitParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.List;

@RestController
@RequestMapping("/baseRole")
@Validated
public class BaseRoleController {
@Autowired
private IBaseRoleService baseRoleService;
    @GetMapping("query")
    public Message query(String name){
        List<BaseRole> list=baseRoleService.query(name);
        return MessageUtil.success(list);
    }
@PostMapping("SaveOrUpdate")

    public Message saveOrUpdate(BaseRole baseRole){
        baseRoleService.saveOrUpdate(baseRole);
        return MessageUtil.success("操作成功");
    }
@DeleteMapping("DeleteById")
@ApiImplicitParam

    public Message deleteById( Long id){
        baseRoleService.deleteById(id);
        return MessageUtil.success( "删除成功");
    }

}
